<?php

	/**
	 * Crawler class
	 *
	 * @author Anton.Perkin
	 *
	 */
	class Crawler
	{
		/**
		 * Page contents
		 *
		 * @var string
		 */
		public $contents;
		
		/**
		 * URL to crawl
		 *
		 * @var string
		 */
		public $url;
		
		/**
		 * Default constructor
		 *
		 * @param string $url URL to crawl
		 */
		public function Crawler($url)
		{
			$this->url = $url;
		}
		
		/**
		 * Crawls the URL
		 *
		 */
		public function Crawl()
		{
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $this->url);
			curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
			curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
			$this->contents = curl_exec($ch);
			curl_close ($ch);
		}
		
		public function ParseContent()
		{
			$dom = new DOMDocument();
			$dom->loadHTML($this->contents);
			
		}
		
	}


	
?>